//
// Created by LiuDongPeng on 2023/11/14.
//

#ifndef TEST_MOTOR_H
#define TEST_MOTOR_H


#include "bsp.h"
#include "arm_math.h"


class motor
{
public:
    motor(int poleNum = 14);

    ~motor() = delete;



    void clark_transform();
    void inv_clark_transform();

    void park_transform();
    void inv_park_transform();

    void get_angle();
    void get_iab();

    void svpwm();

private:
    float32_t ia, ib, ic;
    float32_t ialpha, ibeta;
    float32_t id, iq;
    float32_t uaplha, ubeta;
    float32_t mangle, eangle, sinAngle, cosAngle;
    int m_poleNum = 14;

    float32_t ta, tb, tc;

};


#endif //TEST_MOTOR_H
